<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSessionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sessions', function (Blueprint $table) {
            $table->increments('id');

            $table->string('device_id',50)->unique();
            $table->string('user_uuid',50);
            $table->integer('expire');
            $table->string('access_token',50);
            $table->string('refresh_token',50);
            $table->timestamps();

            $table->index(['device_id','user_uuid']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('sessions');
    }
}
